﻿@model IEnumerable<ITProject.WebUI.Models.Project.ProjectUserViewModel>
@using ITProject.WebUI.Models.Project

@{
    ViewBag.Title = "Użytkownicy projektu " + @Html.Encode(ViewData["ProjectName"]);
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Użytkownicy projektu @Html.Encode(ViewData["ProjectName"])</h2>
<div class="Pmenu">
@Html.Partial(MVC.Shared.Views.Partials._ProjectMenuControl, 
        new ProjectMenuViewModel { ProjectName = (string)ViewData["ProjectName"], Role = (ITProject.Domain.UserRole)ViewData["Role"] })
</div>
<div class="PAplane">
<span class="button" id="SortAscL">Sortowanie A-Z</span>
<span class="button" id="SortDescL">Sortowanie Z-A</span>
<span class="button" id="ShowSuperL">Zarządzający</span>
<span class="button" id="ShowUserL">Uczestnicy</span>
<span class="button" id="ShowAllL">Wszyscy</span>
<p class="small">
Wyszukaj @Html.TextBox("search", "", new { @id = "searchU", @class = "search" })
</p>
<table width="100%" class="inbox" id="TableUser">
<thead>
    <tr>
        <th width="30%">
            Użytkownik
        </th>
        <th width="30%">
            Rola
        </th>
        <th width="40%">Opcje</th>
    </tr>
</thead>
<tbody>
@foreach (var item in Model) {
    <tr class="@item.ProjectRole.ToString()">
        <td class="edit">
            @Html.DisplayFor(modelItem => item.Login)
        </td>
        <td class="edit">
            @Html.DisplayFor(modelItem => item.ProjectRole)
        </td>
        <td class="edit">
            @Html.ActionLink("Profil", MVC.Account.ActionNames.Profil, MVC.Account.Name, new { Login = item.Login }, new { @class = "button" })
        </td>
    </tr>
}


</tbody>
</table>
</div>
<div class="clear"></div>